{% extends "base.html" %}

{% block content %}
    <div class="card mb-4">
        <div class="card-header text-center fs-4">
            处理完成
        </div>
        <div class="card-body">
            <div class="row row-cols-1 row-cols-md-3 g-4">
                {% for file in files %}
                    <div class="col">
                        <div class="card h-100">
                            <img src="{{ url_for('download', filename=file) }}" class="card-img-top" alt="处理后的图片">
                            <div class="card-body">
                                <h5 class="card-title">文件 {{ loop.index }}</h5>
                                <a href="{{ url_for('download', filename=file) }}" class="btn btn-primary">下载</a>
                            </div>
                        </div>
                    </div>
                {% else %}
                    <div class="col-12">
                        <div class="alert alert-warning text-center">
                            没有生成任何文件，请检查上传的图片和处理选项
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
        <div class="card-footer text-center">
            <a href="{{ url_for('index') }}" class="btn btn-secondary">返回首页</a>
        </div>
    </div>
{% endblock %}